import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import Home from '../views/Home.vue'
import Login from '../views/login.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Login',
    component: Login
  },
  {
    path: '/layoutMain',
    name: 'LayoutMain',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/LayoutMain.vue'),
    redirect: '/main',
    children: [
      {
        path: '/main',
        name: 'main',
        component: () => import(/* webpackChunkName: "about" */ '../views/Main.vue')
      },
      {
        path: '/productList',
        name: 'productList',
        component: () => import(/* webpackChunkName: "about" */ '../views/ProductList.vue'),
      },
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
